{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Setup Box Client\n",
    "from box_sdk_gen import DeveloperTokenConfig, BoxDeveloperTokenAuth, BoxClient\n",
    "\n",
    "BOX_DEV_TOKEN = \"your_box_dev_token\"\n",
    "\n",
    "config = DeveloperTokenConfig(BOX_DEV_TOKEN)\n",
    "auth = BoxDeveloperTokenAuth(config)\n",
    "box_client = BoxClient(auth)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "os.environ[\"OPENAI_API_KEY\"] = \"your-key\"\n",
    "\n",
    "from llama_index.core.agent.workflow import FunctionAgent\n",
    "from llama_index.llms.openai import OpenAI"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from llama_index.tools.box import BoxAIPromptToolSpec\n",
    "\n",
    "\n",
    "document_id = \"your_document_id\"\n",
    "ai_prompt = \"Summarize the document\"\n",
    "\n",
    "\n",
    "box_tool = BoxAIPromptToolSpec(box_client=box_client)\n",
    "\n",
    "agent = FunctionAgent(\n",
    "    tools=box_tool.to_tool_list(),\n",
    "    llm=OpenAI(model=\"gpt-4.1\"),\n",
    ")\n",
    "\n",
    "answer = await agent.run(f\"{ai_prompt} for {document_id}\")\n",
    "print(answer)"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
